package Service;

import DAO.SqlHelper;
import Model.News;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class UserService {
    public boolean login(String username,String password)  {
        String sql=String.format("select * from Users where username='%s' and password='%s'",username,password);
        System.out.println(sql);
        try {
        ResultSet rs= SqlHelper.executeQuery(sql);
        if(rs.next()){return true;}
        else return  false; }
        catch (SQLException e) {
            e.printStackTrace();
        }
        return  false;
    }
}
